package com.xoa.controller.cms;

import com.xoa.model.cms.CmsSiteInfo;
import com.xoa.service.cms.CmsSiteService;
import com.xoa.util.common.wrapper.BaseWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("cmsSite")
public class CmsSiteController {
    @Autowired
    private CmsSiteService cmsSiteService;

    @ResponseBody
    @RequestMapping("/addSiteInfo")
    public BaseWrapper addSiteInfo(HttpServletRequest request, CmsSiteInfo siteInfo){
        return cmsSiteService.addSiteInfo(siteInfo,request);
    }

    @ResponseBody
    @RequestMapping("/updateSiteInfo")
    public BaseWrapper updateSiteInfo(CmsSiteInfo siteInfo){
        return cmsSiteService.updateSiteInfo(siteInfo);
    }
    @ResponseBody
    @RequestMapping("/delSiteInfo")
    public BaseWrapper delSiteInfo(Integer sid){
       return   cmsSiteService.delSiteInfo(sid);
    }
    @ResponseBody
    @RequestMapping("/getSiteInfo")
    public CmsSiteInfo getSiteInfo(Integer siteId){
        return cmsSiteService.getSiteInfo(siteId);
    }

    @ResponseBody
    @RequestMapping("/getSiteList")
    public BaseWrapper getSiteList(){
        return cmsSiteService.getSiteList();
    }


    /**
     * @作者: 张航宁
     * @时间: 19-05-24 14:51
     * @说明: 修改发布状态
     */
    @ResponseBody
    @RequestMapping("/updatePubStatus")
    public BaseWrapper updatePubStatus(CmsSiteInfo siteInfo){
        return cmsSiteService.updatePubStatus(siteInfo);
    }

    @ResponseBody
    @RequestMapping("/getSiteInfoBySiteId")
    public BaseWrapper getSiteInfoBySiteId(Integer siteId){
        return cmsSiteService.getSiteInfoBySiteId(siteId);
    }
}
